﻿namespace MDXStudio.Tracing
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using WeifenLuo.WinFormsUI.Docking;

    internal class TracerDlg : DockContent
    {
        private IContainer components;
        private UcTracer mUcTracer;

        public TracerDlg()
        {
            this.InitializeComponent();
            this.mUcTracer = new UcTracer();
            base.Controls.Add(this.mUcTracer);
            this.mUcTracer.Dock = DockStyle.Fill;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(TracerDlg));
            base.SuspendLayout();
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x34d, 0x22a);
            base.Icon = (Icon) manager.GetObject("$this.Icon");
            base.Name = "TracerDlg";
            base.TabText = "TracerDlg";
            this.Text = "TracerDlg";
            base.FormClosing += new FormClosingEventHandler(this.TracerDlg_FormClosing);
            base.ResumeLayout(false);
        }

        private void TracerDlg_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (this.mUcTracer.Tracer.State != eTracerState.Disconnected)
            {
                this.mUcTracer.Tracer.OnDisconnect();
            }
        }

        public MDXStudio.Tracing.Tracer Tracer
        {
            get
            {
                return this.mUcTracer.Tracer;
            }
        }
    }
}

